#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main()
{
    int n = 0;
    for (n = 0; n < 100000; n++)
    {

        int count = 0;

        int tag = n;
        int total = 0;
        while (tag )
        {
            count++;
            tag = tag / 10;
            
            
                int num = pow(10, count);
                total = total + (n / num) * (n % num);

            
        }
        
        if (n == total)
        {
            printf("%d ", n);
        }
    }

    return 0;
}